/******************************************
 * title.h - the title menu for the 
 * CS 467 game.
 *
 * Should be run before the actual game,
 * will return info for the game start up.
 *
 * Author: Jeremy Zito
 * Date: 1/24/07
 ******************************************/

#ifndef TITLE_H
#define TITLE_H



#include <map>
#include "guiz.h"
#include "Vec3f.h"
#include "Star.h"
#include "GameInitInfo.h"
#include "GraphicsWindow.h"


using namespace std;



class TitleMenu : public GraphicsWindow{

	public:		
		 
		//Title constructor
		TitleMenu();

		//Title destructor
		~TitleMenu();

		//start the title menu
		GameInitInfo startTitle();
  

    private:

		//the gui object
		GUIZ gui;
		//create a GameInfo object
		GameInitInfo gi;
		// viewer/eye position
		float eye_x, eye_y, eye_z;
		//for rotation
		float rot;
		//screen width and height
		int width, height;
		//array of screen resolutions
		string screenResolutions[4];
		//index of the current screen res
		int curResolution;
		//the number of moon to start a game with
		int numMoons;

		//map to hold pointers to button funcs
		map<int, void*(TitleMenu::*)(void*)>butFuncs;
		
		//stars
		Star* stars;
		unsigned int numStars;
		float ones[4];

		//init the gui
		void initGUI();

		void drawStars();

		//gui button functions
		void* hostGameButtonFunc(void*);
		void* joinGameButtonFunc(void*);
		void* optionsButtonFunc(void*);
		void* quitButtonFunc(void*);
		void* cancelButtonFunc(void*);
		void* joinOKButtonFunc(void*);
		void* hostOKButtonFunc(void*);
		void* optionsOKButtonFunc(void*);
		void* gameOptionsOKButtonFunc(void*);
		void* gameOptionsButtonFunc(void*);
		void* incResButtonFunc(void*);
		void* decResButtonFunc(void*);
		void* incMoonButtonFunc(void*);
		void* decMoonButtonFunc(void*);
		


		//called by callbacks
		void displayFunc();
		void idleFunc(void);
		void keyboardFunc(unsigned char key, int x, int y);
		void motionFunc(int x, int y);
		void mouseFunc(int button, int state, int x, int y);
		void passiveMotionFunc(int x, int y);
		void reshapeFunc(int w, int h);

};

#endif   /* TITLE_H */
